package com.qf.web;

import com.qf.service.OrderService;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Controller;

@Controller
public class OrderController {


    public static void main(String[] args) {
        ApplicationContext ioc = new ClassPathXmlApplicationContext("spring.xml");

//        OrderService orderService = ioc.getBean(OrderService.class);
//
//        orderService.show();

        SqlSessionFactory sqlSessionFactory = (SqlSessionFactory) ioc.getBean("sqlSessionFactory");
        SqlSession sqlSession = sqlSessionFactory.openSession();
        System.out.println(sqlSession);

        Object bean = ioc.getBean("&sqlSessionFactory");
        System.out.println(bean);
    }
}
